package cn.itcast.service.impl;

import cn.itcast.dao.AddressDao;
import cn.itcast.pojo.Address;
import cn.itcast.service.AddressService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class AddressServiceImpl implements AddressService {


    @Autowired
    private AddressDao addressDao;

    //分页查询分院信息
    @Override
    public List<Address> findAll() {
        List<Address> all = addressDao.findAll();
        return all;

    }

    //编辑分院信息
    @Override
    public void update(Address address) {
        //更新分院信息
        addressDao.updata(address);

    }


    //添加分院信息
    @Override
    public void submit(Address address) {
        addressDao.submit(address);
    }

    //查询检查组基本信息
    @Override
    public Address findById(Integer id) {
        return addressDao.findById(id);
    }

    //更新是否启用按钮
    @Override
    public void updateEnableById(Integer id, Integer enable) {
        addressDao.updateEnableById(id,enable);
    }


}
